From 19aec4217bd5f588072fa5b938ccbb66e2cb144d Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 2 Nov 2009 20:38:02 +0000 Subject: [PATCH] Server-side help. Improve track split. Implement 'nuke types' in misc filters. --- gui/README.contrib | 228 ++++++++++++------------- gui/README.gui | 10 +- gui/aboutui.ui | 62 +++++-- gui/advdlg.cpp | 6 +- gui/advdlg.h | 4 +- gui/advui.ui | 14 +- gui/app.rc | 2 +- gui/filterdata.cpp | 52 +++--- gui/filterdata.h | 16 +- gui/filterwidgets.cpp | 81 +++++++-- gui/filterwidgets.h | 23 +-- gui/format.cpp | 140 +++++++-------- gui/format.h | 385 ++++++++++++++++++++++-------------------- gui/formatload.cpp | 11 +- gui/gmapdlg.cpp | 9 +- gui/gmapdlg.h | 3 +- gui/gmapui.ui | 120 +++++++++---- gui/help.cpp | 31 ++-- gui/help.h | 60 +++---- gui/mainwindow.cpp | 15 +- gui/miscfltui.ui | 40 ++++- gui/optionsdlg.cpp | 12 +- gui/optionsdlg.h | 6 +- gui/setup.iss | 6 +- gui/trackui.ui | 169 +++++++++--------- 25 files changed, 866 insertions(+), 639 deletions(-) diff --git a/gui/README.contrib b/gui/README.contrib index 9e4da0e07..6e447a29d 100644 --- a/gui/README.contrib +++ b/gui/README.contrib @@ -1,114 +1,114 @@ -If you're interested in contributing to this program, here are some -guidelines. Mail patches to gpsbabel-code@lists.sourceforge.net for -consideration and integration. - -Rules to Live By ----------------- - -Standards are good. ISO C and POSIX are greatly preferred. - -Reuse is good, if doing so is not onerous. For example, using the expat -libraries vastly simplifies the XML parsers while increasing their -robustness plus those libraries are ubiquitous. So I consider it OK to -require expat. - -You may find format_skeleton.c and filter_skeleton.c in the source tree -to be helpful examples. Just add meat! - -Compilers complain for a reason. Code shouldn't emit warnings. - -The entire world doesn't run . I've tested this code on -at least five different OSes. If you find yourself wanting to insert -compiler or OS specific magic, please resist. - -Coding consistency is encouraged. The reality is we have a lot of code -that was written by different authors. Some code from other projects is -included. We don't have immutable rules about code style (indention, -curly location, whitespace rules, etc.) but we do ask that you try to -match what is around any code you modify. "When in Rome..." - -If writing new code, we'd prefer a style like: - - int - mumble(int whatever) - { - if (whatevever) { - return blah; - } - } - -...but if you're submitting a new source file that you intend to -maintain and are convinced that two space indents will make the world a -better place, knock yourself out. But if you need to add a line of code -to the above before "return blah" and do it with spaces instead of hard -tabs, that would be bad. - -Submitting Patches ------------------- - -If you are creating a new target you should submit patches (use -"cvs diff -uN" to create patches) to the following files: -* Yourcode.c and/or Yourcode.h - this is the code required to do your - conversions and any support files that your code requires. -* vecs.c - an updated vecs.c file implementing your conversion code into - GPSBabel. -* Makefile - an updated Makefile telling the compiler how to build and link - your conversion into GPSBabel -* testo - an updated script that tests your conversion (this should produce - no output if all is good, see the current testo script for examples) -* YourOutput - a sample file of code produced by your function (used in testo - and lives in a directory called "reference"). -* Documentation - see below. - -Please ensure that you are building and testing against the latest code -from the top of the CVS tree and that any code you modify is the latest -version from the CVS - Note: code changes sometimes occur frequently! - -Documentation -------------- - -HTML and text documentation are generated automatically from DocBook -source located in the "xmldoc" directory. That directory contains -two subdirectories of interest: "formats" and "filters". If your -contribution adds or affects a format, you'll want to be in the "formats" -directory. Otherwise, you'll want to be in the "filters" directory. - -You should contribute a file called "yourname.xml", where "yourname" is the -name you would give on the command-line to invoke your new format or filter. -For example, the arc filter is documented in "filters/arc.xml". - -This file contains a general description of your format or filter, any -limitations in your support for it, and anything else the end user should -know. For file formats, links to manufacturers' websites are encouraged. -The contents of this file are not valid or even well-formed XML on their own; -they are included into a larger framework. If you know DocBook, you should -ensure that the contents of this file will validate if included in a
. -If you do not know DocBook, see the other files in this directory for examples -or see http://docbook.org/tdg/en/html/docbook.html for the gory details. Tags -of interest will almost certainly include for paragraphs, - for web links, and for -example command lines. - -For each option supported by your format or filter, you should also contribute -a file in the "options" subdirectory called "yourname-youroption.xml", again -using the names you would use on the command line to invoke your format or -filter with that particular option. For example, the "distance" option to the -"arc" filter is documented in "filters/options/arc-distance.xml". These -files are similar to the general description above, and should meet the same -validation requirements. - -As of this writing, there are two formats that violate this rule: Magellan -serial and Microsoft Streets & Trips. Because those formats have the same -names as other formats, their descriptions are located in "magellan1.xml" and -"msroute1.xml" respectively. These are special cases, and you should do your -best to ensure that they remain the only special cases. - -Note that the automated framework already includes the name and description of -your format and its options as described in vecs.c and yourcode.c, so there is -no need to repeat that information in your documentation. - - -Enjoy! - -Robert Lipe, -robertlipe@usa.net +If you're interested in contributing to this program, here are some +guidelines. Mail patches to gpsbabel-code@lists.sourceforge.net for +consideration and integration. + +Rules to Live By +---------------- + +Standards are good. ISO C and POSIX are greatly preferred. + +Reuse is good, if doing so is not onerous. For example, using the expat +libraries vastly simplifies the XML parsers while increasing their +robustness plus those libraries are ubiquitous. So I consider it OK to +require expat. + +You may find format_skeleton.c and filter_skeleton.c in the source tree +to be helpful examples. Just add meat! + +Compilers complain for a reason. Code shouldn't emit warnings. + +The entire world doesn't run . I've tested this code on +at least five different OSes. If you find yourself wanting to insert +compiler or OS specific magic, please resist. + +Coding consistency is encouraged. The reality is we have a lot of code +that was written by different authors. Some code from other projects is +included. We don't have immutable rules about code style (indention, +curly location, whitespace rules, etc.) but we do ask that you try to +match what is around any code you modify. "When in Rome..." + +If writing new code, we'd prefer a style like: + + int + mumble(int whatever) + { + if (whatevever) { + return blah; + } + } + +...but if you're submitting a new source file that you intend to +maintain and are convinced that two space indents will make the world a +better place, knock yourself out. But if you need to add a line of code +to the above before "return blah" and do it with spaces instead of hard +tabs, that would be bad. + +Submitting Patches +------------------ + +If you are creating a new target you should submit patches (use +"cvs diff -uN" to create patches) to the following files: +* Yourcode.c and/or Yourcode.h - this is the code required to do your + conversions and any support files that your code requires. +* vecs.c - an updated vecs.c file implementing your conversion code into + GPSBabel. +* Makefile - an updated Makefile telling the compiler how to build and link + your conversion into GPSBabel +* testo - an updated script that tests your conversion (this should produce + no output if all is good, see the current testo script for examples) +* YourOutput - a sample file of code produced by your function (used in testo + and lives in a directory called "reference"). +* Documentation - see below. + +Please ensure that you are building and testing against the latest code +from the top of the CVS tree and that any code you modify is the latest +version from the CVS - Note: code changes sometimes occur frequently! + +Documentation +------------- + +HTML and text documentation are generated automatically from DocBook +source located in the "xmldoc" directory. That directory contains +two subdirectories of interest: "formats" and "filters". If your +contribution adds or affects a format, you'll want to be in the "formats" +directory. Otherwise, you'll want to be in the "filters" directory. + +You should contribute a file called "yourname.xml", where "yourname" is the +name you would give on the command-line to invoke your new format or filter. +For example, the arc filter is documented in "filters/arc.xml". + +This file contains a general description of your format or filter, any +limitations in your support for it, and anything else the end user should +know. For file formats, links to manufacturers' websites are encouraged. +The contents of this file are not valid or even well-formed XML on their own; +they are included into a larger framework. If you know DocBook, you should +ensure that the contents of this file will validate if included in a
. +If you do not know DocBook, see the other files in this directory for examples +or see http://docbook.org/tdg/en/html/docbook.html for the gory details. Tags +of interest will almost certainly include for paragraphs, + for web links, and for +example command lines. + +For each option supported by your format or filter, you should also contribute +a file in the "options" subdirectory called "yourname-youroption.xml", again +using the names you would use on the command line to invoke your format or +filter with that particular option. For example, the "distance" option to the +"arc" filter is documented in "filters/options/arc-distance.xml". These +files are similar to the general description above, and should meet the same +validation requirements. + +As of this writing, there are two formats that violate this rule: Magellan +serial and Microsoft Streets & Trips. Because those formats have the same +names as other formats, their descriptions are located in "magellan1.xml" and +"msroute1.xml" respectively. These are special cases, and you should do your +best to ensure that they remain the only special cases. + +Note that the automated framework already includes the name and description of +your format and its options as described in vecs.c and yourcode.c, so there is +no need to repeat that information in your documentation. + + +Enjoy! + +Robert Lipe, +robertlipe@usa.net diff --git a/gui/README.gui b/gui/README.gui index 750c2da2d..2c285d30e 100644 --- a/gui/README.gui +++ b/gui/README.gui @@ -1,5 +1,5 @@ -* Adding your own language to GPSBabelFE * -------------------------------------------- - -To be written. - +* Adding your own language to GPSBabelFE * +------------------------------------------- + +To be written. + diff --git a/gui/aboutui.ui b/gui/aboutui.ui index 6d401b7d7..b359e6f81 100644 --- a/gui/aboutui.ui +++ b/gui/aboutui.ui @@ -6,8 +6,8 @@ 0 0 - 710 - 430 + 650 + 284 @@ -17,17 +17,53 @@ - - - - - - :/images/appicon.png - - - false - - + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 100 + 100 + + + + + + + :/images/appicon.png + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + diff --git a/gui/advdlg.cpp b/gui/advdlg.cpp index 885e7c491..eecd1d346 100644 --- a/gui/advdlg.cpp +++ b/gui/advdlg.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: advdlg.cpp,v 1.2 2009/08/28 17:08:55 robertl Exp $ +// $Id: advdlg.cpp,v 1.3 2009/11/02 20:38:02 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -28,20 +28,17 @@ //------------------------------------------------------------------------ AdvDlg::AdvDlg(QWidget* parent, bool &synthShortNames, - bool &forceGPSTypes, bool &enableCharSetXform, bool &previewGmap, int &debugLevel): QDialog(parent), synthShortNames(synthShortNames), - forceGPSTypes(forceGPSTypes), enableCharSetXform(enableCharSetXform), previewGmap(previewGmap), debugLevel(debugLevel) { ui.setupUi(this); ui.synthShortNames->setChecked(synthShortNames); - ui.forceGPSTypes->setChecked(forceGPSTypes); ui.enableCharSetXform->setChecked(enableCharSetXform); ui.previewGmap->setChecked(previewGmap); ui.debugCombo->setCurrentIndex(debugLevel+1); @@ -54,7 +51,6 @@ AdvDlg::AdvDlg(QWidget* parent, void AdvDlg::acceptClicked() { synthShortNames = ui.synthShortNames->isChecked(); - forceGPSTypes = ui.forceGPSTypes->isChecked(); enableCharSetXform = ui.enableCharSetXform->isChecked(); previewGmap = ui.previewGmap->isChecked(); debugLevel = ui.debugCombo->currentIndex()-1; diff --git a/gui/advdlg.h b/gui/advdlg.h index 9f0f951ff..c26821383 100644 --- a/gui/advdlg.h +++ b/gui/advdlg.h @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: advdlg.h,v 1.1 2009/07/05 21:14:56 robertl Exp $ +// $Id: advdlg.h,v 1.2 2009/11/02 20:38:02 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -30,7 +30,6 @@ class AdvDlg: public QDialog { public: AdvDlg(QWidget* parent, bool &synthShortNames, - bool &forceGPSTypes, bool &enableCharSetXform, bool &previewGmap, int &debugLevel); @@ -39,7 +38,6 @@ public: private: Ui_AdvUi ui; bool &synthShortNames; - bool &forceGPSTypes; bool &enableCharSetXform; bool &previewGmap; int &debugLevel; diff --git a/gui/advui.ui b/gui/advui.ui index 631682fa9..11596c4f7 100644 --- a/gui/advui.ui +++ b/gui/advui.ui @@ -6,8 +6,8 @@ 0 0 - 347 - 222 + 280 + 185 @@ -24,16 +24,6 @@ - - - - false - - - Force Selected GPS data types (nuketypes filter) - - - diff --git a/gui/app.rc b/gui/app.rc index 78c3979f0..5f0fddf3b 100644 --- a/gui/app.rc +++ b/gui/app.rc @@ -1 +1 @@ -IDI_ICON1 ICON DISCARDABLE "images/appicon.ico" +IDI_ICON1 ICON DISCARDABLE "images/appicon.ico" diff --git a/gui/filterdata.cpp b/gui/filterdata.cpp index b961f006c..1231a3a45 100644 --- a/gui/filterdata.cpp +++ b/gui/filterdata.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: filterdata.cpp,v 1.3 2009/08/28 17:08:55 robertl Exp $ +// $Id: filterdata.cpp,v 1.4 2009/11/02 20:38:02 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -88,27 +88,32 @@ QStringList TrackFilterData::makeOptionString() if (speed) s += ",speed"; if (pack) s += ",pack"; if (merge) s += ",merge"; - if (split && (pack || merge)) { - s += ",split"; - if (splitTime > 0) - s += QString("=%1%2").arg(splitTime).arg("mhd"[splitTimeUnit]); - } - if (splitDist > 0) { - double d = splitDist; - char u = ' '; - if (splitDistUnit == 0) { // ft. - d /= 5280.0; u = 'm'; - } - else if (splitDistUnit == 1) { //m - d /= 1000.0; u = 'k'; + if (pack || merge) { + if (splitByDate) { + s += ",split"; } - else if (splitDistUnit == 2) { //km - u = 'k'; + if (splitByTime) { + s += ",split"; + if (splitTime > 0) + s += QString("=%1%2").arg(splitTime).arg("mhd"[splitTimeUnit]); } - else if (splitDistUnit == 3) { //m - u = 'm'; + if (splitByDistance && splitDist > 0) { + double d = splitDist; + char u = ' '; + if (splitDistUnit == 0) { // ft. + d /= 5280.0; u = 'm'; + } + else if (splitDistUnit == 1) { //m + d /= 1000.0; u = 'k'; + } + else if (splitDistUnit == 2) { //km + u = 'k'; + } + else if (splitDistUnit == 3) { //m + u = 'm'; + } + s += QString(",sdistance=%1%2").arg(d).arg(u); } - s += QString(",sdistance=%1%2").arg(d).arg(u); } if (start) s += QString(",start=%1").arg(optionDate(startTime, TZ)); @@ -142,6 +147,15 @@ QStringList MiscFltFilterData::makeOptionString() if (!inUse) return args; + if (nukeRoutes || nukeTracks || nukeWaypoints) { + args << QString("-x"); + QString s = "nuketypes"; + if (nukeRoutes) s += ",routes"; + if (nukeTracks) s += ",tracks"; + if (nukeWaypoints) s += ",waypoints"; + args << s; + } + if (swap) args << "-x" << "swap"; if (transform) { diff --git a/gui/filterdata.h b/gui/filterdata.h index 8946e386f..a6bc3d195 100644 --- a/gui/filterdata.h +++ b/gui/filterdata.h @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: filterdata.h,v 1.3 2009/09/02 19:05:27 robertl Exp $ +// $Id: filterdata.h,v 1.4 2009/11/02 20:38:02 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -62,6 +62,9 @@ class TrackFilterData: public FilterData { stop(false), pack(false), merge(false), split(false), GPSFixes(false), GPSFixesVal(0), + splitByDate(false), + splitByTime(false), + splitByDistance(false), course(false), speed(false), splitTime(0), splitTimeUnit(0), splitDist(0), splitDistUnit(0) @@ -82,6 +85,9 @@ class TrackFilterData: public FilterData { sg.addVarSetting(new BoolSetting("trks.pack", pack)); sg.addVarSetting(new BoolSetting("trks.merge", merge)); sg.addVarSetting(new BoolSetting("trks.split", split)); + sg.addVarSetting(new BoolSetting("trks.splitByDate", splitByDate)); + sg.addVarSetting(new BoolSetting("trks.splitByTime", splitByTime)); + sg.addVarSetting(new BoolSetting("trks.splitByDistance", splitByDistance)); sg.addVarSetting(new BoolSetting("trks.start", start)); sg.addVarSetting(new DateTimeSetting("trks.startTime", startTime)); sg.addVarSetting(new BoolSetting("trks.stop", stop)); @@ -114,6 +120,7 @@ class TrackFilterData: public FilterData { QDateTime stopTime; bool pack, merge, split, GPSFixes; int GPSFixesVal; + bool splitByDate, splitByTime, splitByDistance; bool course, speed; int splitTime, splitTimeUnit; int splitDist, splitDistUnit; @@ -186,6 +193,9 @@ class RtTrkFilterData: public FilterData { class MiscFltFilterData: public FilterData { public: MiscFltFilterData(): FilterData(), + nukeRoutes(false), + nukeTracks(false), + nukeWaypoints(false), transform(false), del(false), swap(false), @@ -196,6 +206,9 @@ class MiscFltFilterData: public FilterData { virtual QStringList makeOptionString(); virtual void makeSettingGroup(SettingGroup &sg) { + sg.addVarSetting(new BoolSetting("mscflt.nukeRoutes", nukeRoutes)); + sg.addVarSetting(new BoolSetting("mscflt.nukeTracks", nukeTracks)); + sg.addVarSetting(new BoolSetting("mscflt.nukeWaypoints", nukeWaypoints)); sg.addVarSetting(new BoolSetting("mscflt.inUse", inUse)); sg.addVarSetting(new BoolSetting("mscflt.transform", transform)); sg.addVarSetting(new IntSetting("mscflt.transformVal", transformVal)); @@ -204,6 +217,7 @@ class MiscFltFilterData: public FilterData { } public: + bool nukeRoutes, nukeTracks, nukeWaypoints; bool transform, del, swap; int transformVal; }; diff --git a/gui/filterwidgets.cpp b/gui/filterwidgets.cpp index eddae4154..cd17b8c32 100644 --- a/gui/filterwidgets.cpp +++ b/gui/filterwidgets.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: filterwidgets.cpp,v 1.4 2009/09/14 14:25:14 robertl Exp $ +// $Id: filterwidgets.cpp,v 1.5 2009/11/02 20:38:02 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -40,11 +40,23 @@ TrackWidget::TrackWidget(QWidget *parent, TrackFilterData &tfd): FilterWidget(pa addCheckEnabler(ui.stopCheck, ui.stopEdit); addCheckEnabler(ui.GPSFixesCheck, ui.GPSFixesCombo); + addCheckEnabler(ui.splitTimeCheck, + (QList () + < () + <setDisplayFormat("dd MMM yyyy hh:mm:ss AP"); ui.stopEdit->setDisplayFormat("dd MMM yyyy hh:mm:ss AP"); @@ -57,7 +69,9 @@ TrackWidget::TrackWidget(QWidget *parent, TrackFilterData &tfd): FilterWidget(pa fopts << new BoolFilterOption(tfd.stop, ui.stopCheck); fopts << new BoolFilterOption(tfd.pack, ui.packCheck); fopts << new BoolFilterOption(tfd.merge, ui.mergeCheck); - fopts << new BoolFilterOption(tfd.split, ui.splitCheck); + fopts << new BoolFilterOption(tfd.splitByDate, ui.splitDateCheck); + fopts << new BoolFilterOption(tfd.splitByTime, ui.splitTimeCheck); + fopts << new BoolFilterOption(tfd.splitByDistance, ui.splitDistanceCheck); fopts << new BoolFilterOption(tfd.GPSFixes, ui.GPSFixesCheck); fopts << new BoolFilterOption(tfd.course, ui.courseCheck); fopts << new BoolFilterOption(tfd.speed, ui.speedCheck); @@ -81,17 +95,19 @@ TrackWidget::TrackWidget(QWidget *parent, TrackFilterData &tfd): FilterWidget(pa } //------------------------------------------------------------------------ -void TrackWidget::OtherCheckX() +void TrackWidget::otherCheckX() { ui.TZCheck->setEnabled(ui.stopCheck->isChecked() || ui.startCheck->isChecked()); - ui.splitCheck->setEnabled(ui.mergeCheck->isChecked() || ui.packCheck->isChecked()); - bool bb = ui.packCheck->isChecked() && ui.splitCheck->isChecked(); - ui.splitTimeSpin->setEnabled(bb); - ui.splitTimeCombo->setEnabled(bb); - - bb = ui.packCheck->isChecked(); - ui.splitDistSpin->setEnabled(bb); - ui.splitDistCombo->setEnabled(bb); + + ui.splitTimeSpin->setEnabled(ui.splitTimeCheck->isChecked()); + ui.splitTimeCombo->setEnabled(ui.splitTimeCheck->isChecked()); + ui.splitDistSpin->setEnabled(ui.splitDistanceCheck->isChecked()); + ui.splitDistCombo->setEnabled(ui.splitDistanceCheck->isChecked()); + + bool bb = (ui.mergeCheck->isChecked() || ui.packCheck->isChecked()); + ui.splitDateCheck->setEnabled(bb); + ui.splitTimeCheck->setEnabled(bb); + ui.splitDistanceCheck->setEnabled(bb); } //------------------------------------------------------------------------ @@ -99,17 +115,45 @@ void TrackWidget::mergeCheckX() { if (ui.mergeCheck->isChecked()) ui.packCheck->setChecked(false); - OtherCheckX(); + otherCheckX(); } //------------------------------------------------------------------------ - void TrackWidget::packCheckX() { if (ui.packCheck->isChecked()) ui.mergeCheck->setChecked(false); - OtherCheckX(); + otherCheckX(); } +//------------------------------------------------------------------------ +void TrackWidget::splitDateX() +{ + if (ui.splitDateCheck->isChecked()) { + ui.splitTimeCheck->setChecked(false); + ui.splitDistanceCheck->setChecked(false); + } + otherCheckX(); +} +//------------------------------------------------------------------------ +void TrackWidget::splitTimeX() +{ + if (ui.splitTimeCheck->isChecked()) { + ui.splitDateCheck->setChecked(false); + ui.splitDistanceCheck->setChecked(false); + } + otherCheckX(); +} +//------------------------------------------------------------------------ +void TrackWidget::splitDistanceX() +{ + if (ui.splitDistanceCheck->isChecked()) { + ui.splitDateCheck->setChecked(false); + ui.splitTimeCheck->setChecked(false); + } + otherCheckX(); +} + + //------------------------------------------------------------------------ //------------------------------------------------------------------------ WayPtsWidget::WayPtsWidget(QWidget *parent, WayPtsFilterData &wfd): FilterWidget(parent) , wfd(wfd) @@ -186,6 +230,9 @@ MiscFltWidget::MiscFltWidget(QWidget *parent, MiscFltFilterData &mfd): FilterWid fopts << new BoolFilterOption(mfd.transform, ui.transformCheck); fopts << new BoolFilterOption(mfd.swap, ui.swapCheck); fopts << new BoolFilterOption(mfd.del, ui.deleteCheck); + fopts << new BoolFilterOption(mfd.nukeTracks, ui.nukeTracks); + fopts << new BoolFilterOption(mfd.nukeRoutes, ui.nukeRoutes); + fopts << new BoolFilterOption(mfd.nukeWaypoints, ui.nukeWaypoints); fopts << new ComboFilterOption(mfd.transformVal, ui.transformCombo); setWidgetValues(); diff --git a/gui/filterwidgets.h b/gui/filterwidgets.h index ee5779fb5..34b2f9de7 100644 --- a/gui/filterwidgets.h +++ b/gui/filterwidgets.h @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: filterwidgets.h,v 1.1 2009/07/05 21:14:56 robertl Exp $ +// $Id: filterwidgets.h,v 1.2 2009/11/02 20:38:02 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -37,14 +37,14 @@ class CheckEnabler: public QObject { Q_OBJECT public: - CheckEnabler(QObject *parent, QCheckBox *ck, QWidget *w): QObject(parent), checkBox(ck) + CheckEnabler(QObject *parent, QAbstractButton *ck, QWidget *w): QObject(parent), checkBox(ck) { widgetList << w; connect(ck, SIGNAL(clicked()), this, SLOT(checkStatusChanged())); checkStatusChanged(); fixWhatsThis(); } - CheckEnabler(QObject *parent, QCheckBox *ck, QList &wl): + CheckEnabler(QObject *parent, QAbstractButton *ck, QList &wl): QObject(parent), checkBox(ck) { widgetList = wl; @@ -63,7 +63,7 @@ public slots: } private: - QCheckBox *checkBox; + QAbstractButton *checkBox; QList widgetList; void fixWhatsThis() { @@ -101,7 +101,7 @@ class FilterOption class BoolFilterOption: public FilterOption { public: - BoolFilterOption(bool &b, QCheckBox *ck): FilterOption(), b(b), checkBox(ck) + BoolFilterOption(bool &b, QAbstractButton *ck): FilterOption(), b(b), checkBox(ck) { } void setWidgetValue() {checkBox->setChecked(b); } @@ -109,7 +109,7 @@ class BoolFilterOption: public FilterOption private: bool &b; - QCheckBox *checkBox; + QAbstractButton *checkBox; }; //------------------------------------------------------------------------ @@ -224,10 +224,10 @@ public: for (int i=0; isetWidgetValue(); } - void addCheckEnabler(QCheckBox *ck, QWidget *w) { + void addCheckEnabler(QAbstractButton *ck, QWidget *w) { enbls << new CheckEnabler(this, ck, w); } - void addCheckEnabler(QCheckBox *ck, QList &wl) + void addCheckEnabler(QAbstractButton *ck, QList &wl) { enbls << new CheckEnabler(this, ck, wl); } @@ -250,7 +250,7 @@ Q_OBJECT TrackWidget(QWidget *parent, TrackFilterData &tf); virtual void checkChecks(){ - OtherCheckX(); + otherCheckX(); FilterWidget::checkChecks(); } @@ -260,7 +260,10 @@ Q_OBJECT private slots: void mergeCheckX(); - void OtherCheckX(); + void otherCheckX(); + void splitDateX(); + void splitTimeX(); + void splitDistanceX(); void packCheckX(); }; diff --git a/gui/format.cpp b/gui/format.cpp index c6b3a1c99..155566699 100644 --- a/gui/format.cpp +++ b/gui/format.cpp @@ -1,69 +1,71 @@ -// -*- C++ -*- -// $Id: format.cpp,v 1.1 2009/07/05 21:14:56 robertl Exp $ -//------------------------------------------------------------------------ -// -// Copyright (C) 2009 S. Khai Mong . -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 -// USA -// -//------------------------------------------------------------------------ -#include "format.h" - -static void saveOptions(QSettings &settings, const QString &prefix, const QList &options) { - for (int i=0; i &options) { - for (int i=0; i. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation; either version 2 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 +// USA +// +//------------------------------------------------------------------------ +#include "format.h" + +QString Format::htmlBase = QString(); + +static void saveOptions(QSettings &settings, const QString &prefix, const QList &options) { + for (int i=0; i &options) { + for (int i=0; i. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 -// USA -// -//------------------------------------------------------------------------ -#ifndef FORMAT_H -#define FORMAT_H - -#include -#include -#include -#include - -class FormatOption -{ -public: - typedef enum { - OPTstring, - OPTbool, - OPTint, - OPTboundedInt, - OPTfloat, - OPTinFile, - OPToutFile, - } optionType; - - FormatOption(): name(QString()), description(QString()), type(OPTbool), - defaultValue(QVariant()), - minValue(QVariant()), maxValue(QVariant()), - html(QString()), value(QVariant()), selected(false) - { - } - FormatOption(const QString &name, - const QString &description, - optionType type, - QVariant defaultValue = QVariant(), - QVariant minValue = QVariant(), - QVariant maxValue = QVariant(), - QString html = QString() - ): name(name), description(description), type(type), - defaultValue(defaultValue), minValue(minValue), maxValue(maxValue), html(html) - { - value = QVariant(); - selected = false; - } - FormatOption(const FormatOption & c) - : name(c.name), description(c.description), type(c.type), - defaultValue(c.defaultValue), minValue(c.minValue), maxValue(c.maxValue), html(c.html), - value(c.value), selected(c.selected) - { - } - - QString getName() const {return name; } - QString getDescription() const {return description; } - optionType getType() const {return type; } - QVariant getValue() const { return value; } - bool getSelected() const {return selected; } - QVariant getMinValue() const {return minValue; } - QVariant getMaxValue() const {return maxValue; } - QVariant getDefaultValue() const {return defaultValue; } - - void setValue(QVariant v) { value = v; }; - void setSelected(bool v) { selected = v; }; - -private: - QString name; - QString description; - optionType type; - QVariant defaultValue; - QVariant minValue; - QVariant maxValue; - QString html; - QVariant value; - bool selected; -}; - - -//------------------------------------------------------------------------ -class Format -{ - public: - Format():name(QString()), - description(QString()), - readWaypoints(false), - readTracks(false), - readRoutes(false), - writeWaypoints(false), - writeTracks(false), - writeRoutes(false), - fileFormat(false), - deviceFormat(false), - extensions(QStringList()) - { - inputOptions.clear(); - outputOptions.clear(); - }; - - Format(const QString &name, - const QString &description, - bool readWaypoints, bool readTracks, bool readRoutes, - bool writeWaypoints, bool writeTracks, bool writeRoutes, - bool fileFormat, bool deviceFormat, - const QStringList &extensions, - QList &inputOptions, - QList &outputOptions): - name(name), description(description), - readWaypoints(readWaypoints), readTracks(readTracks), readRoutes(readRoutes), - writeWaypoints(writeWaypoints), writeTracks(writeTracks), writeRoutes(writeRoutes), - fileFormat(fileFormat), deviceFormat(deviceFormat), - extensions(extensions), - inputOptions(inputOptions), - outputOptions(outputOptions) - { - } - - Format(const Format &c): - name(c.name), description(c.description), - readWaypoints(c.readWaypoints), readTracks(c.readTracks), readRoutes(c.readRoutes), - writeWaypoints(c.writeWaypoints), writeTracks(c.writeTracks), writeRoutes(c.writeRoutes), - fileFormat(c.fileFormat), deviceFormat(c.deviceFormat), - extensions(c.extensions), - inputOptions(c.inputOptions), - outputOptions(c.outputOptions) - { - } - - ~Format() {}; - - bool isReadWaypoints() const { return readWaypoints; }; - bool isReadTracks() const { return readTracks; }; - bool isReadRoutes() const { return readRoutes; }; - bool isReadSomething() const { - return isReadWaypoints() || isReadTracks () || isReadRoutes(); - }; - - bool isWriteWaypoints() const { return writeWaypoints; }; - bool isWriteTracks() const { return writeTracks; }; - bool isWriteRoutes() const { return writeRoutes; }; - bool isWriteSomething() const { - return isWriteWaypoints() || isWriteTracks () || isWriteRoutes(); - }; - - QString getName() const { return name; }; - QString getDescription() const { return description; }; - QStringList getExtensions() const { return extensions; }; - const QList &getInputOptions() const { return inputOptions; }; - const QList &getOutputOptions() const { return outputOptions; }; - - QList *getInputOptionsRef() { return &inputOptions; }; - QList *getOutputOptionsRef() { return &outputOptions; }; - - bool isDeviceFormat() const { return deviceFormat; }; - bool isFileFormat() const { return fileFormat; }; - - void saveSettings(QSettings &settings); - void restoreSettings(QSettings &settings); - void setToDefault(); - - private: - QString name, description; - bool readWaypoints, readTracks, readRoutes; - bool writeWaypoints, writeTracks, writeRoutes; - bool fileFormat, deviceFormat; - QStringList extensions; - QListinputOptions; - QListoutputOptions; - -}; - -#endif +// -*- C++ -*- +// $Id: format.h,v 1.2 2009/11/02 20:38:02 robertl Exp $ +//------------------------------------------------------------------------ +// +// Copyright (C) 2009 S. Khai Mong . +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation; either version 2 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 +// USA +// +//------------------------------------------------------------------------ +#ifndef FORMAT_H +#define FORMAT_H + +#include +#include +#include +#include + +class FormatOption +{ +public: + typedef enum { + OPTstring, + OPTbool, + OPTint, + OPTboundedInt, + OPTfloat, + OPTinFile, + OPToutFile, + } optionType; + + FormatOption(): name(QString()), description(QString()), type(OPTbool), + defaultValue(QVariant()), + minValue(QVariant()), maxValue(QVariant()), + html(QString()), value(QVariant()), selected(false) + { + } + FormatOption(const QString &name, + const QString &description, + optionType type, + QVariant defaultValue = QVariant(), + QVariant minValue = QVariant(), + QVariant maxValue = QVariant(), + QString html = QString() + ): name(name), description(description), type(type), + defaultValue(defaultValue), minValue(minValue), maxValue(maxValue), html(html) + { + value = QVariant(); + selected = false; + } + + FormatOption(const FormatOption & c) + : name(c.name), description(c.description), type(c.type), + defaultValue(c.defaultValue), minValue(c.minValue), maxValue(c.maxValue), html(c.html), + value(c.value), selected(c.selected) + { + } + + QString getName() const {return name; } + QString getDescription() const {return description; } + optionType getType() const {return type; } + QVariant getValue() const { return value; } + bool getSelected() const {return selected; } + QVariant getMinValue() const {return minValue; } + QVariant getMaxValue() const {return maxValue; } + QVariant getDefaultValue() const {return defaultValue; } + + void setValue(QVariant v) { value = v; }; + void setSelected(bool v) { selected = v; }; + QString getHtml() const { return html; }; + +private: + QString name; + QString description; + optionType type; + QVariant defaultValue; + QVariant minValue; + QVariant maxValue; + QString html; + QVariant value; + bool selected; +}; + + +//------------------------------------------------------------------------ +class Format +{ + public: + Format():name(QString()), + description(QString()), + readWaypoints(false), + readTracks(false), + readRoutes(false), + writeWaypoints(false), + writeTracks(false), + writeRoutes(false), + fileFormat(false), + deviceFormat(false), + extensions(QStringList()), + html(QString()) + { + inputOptions.clear(); + outputOptions.clear(); + }; + + Format(const QString &name, + const QString &description, + bool readWaypoints, bool readTracks, bool readRoutes, + bool writeWaypoints, bool writeTracks, bool writeRoutes, + bool fileFormat, bool deviceFormat, + const QStringList &extensions, + QList &inputOptions, + QList &outputptions, + const QString &html): + name(name), description(description), + readWaypoints(readWaypoints), readTracks(readTracks), readRoutes(readRoutes), + writeWaypoints(writeWaypoints), writeTracks(writeTracks), writeRoutes(writeRoutes), + fileFormat(fileFormat), deviceFormat(deviceFormat), + extensions(extensions), + inputOptions(inputOptions), + outputOptions(outputptions), + html(QString()) + { + } + + Format(const Format &c): + name(c.name), description(c.description), + readWaypoints(c.readWaypoints), readTracks(c.readTracks), readRoutes(c.readRoutes), + writeWaypoints(c.writeWaypoints), writeTracks(c.writeTracks), writeRoutes(c.writeRoutes), + fileFormat(c.fileFormat), deviceFormat(c.deviceFormat), + extensions(c.extensions), + inputOptions(c.inputOptions), + outputOptions(c.outputOptions), + html(c.html) + { + } + + ~Format() {}; + + bool isReadWaypoints() const { return readWaypoints; }; + bool isReadTracks() const { return readTracks; }; + bool isReadRoutes() const { return readRoutes; }; + bool isReadSomething() const { + return isReadWaypoints() || isReadTracks () || isReadRoutes(); + }; + + bool isWriteWaypoints() const { return writeWaypoints; }; + bool isWriteTracks() const { return writeTracks; }; + bool isWriteRoutes() const { return writeRoutes; }; + bool isWriteSomething() const { + return isWriteWaypoints() || isWriteTracks () || isWriteRoutes(); + }; + + QString getName() const { return name; }; + QString getDescription() const { return description; }; + QString getHtml() const { return html; }; + QStringList getExtensions() const { return extensions; }; + const QList &getInputOptions() const { return inputOptions; }; + const QList &getOutputOptions() const { return outputOptions; }; + + QList *getInputOptionsRef() { return &inputOptions; }; + QList *getOutputOptionsRef() { return &outputOptions; }; + + bool isDeviceFormat() const { return deviceFormat; }; + bool isFileFormat() const { return fileFormat; }; + + void saveSettings(QSettings &settings); + void restoreSettings(QSettings &settings); + void setToDefault(); + static QString getHtmlBase() { return htmlBase; } + static void setHtmlBase(const QString &s) { htmlBase = s; } + + private: + QString name, description; + bool readWaypoints, readTracks, readRoutes; + bool writeWaypoints, writeTracks, writeRoutes; + bool fileFormat, deviceFormat; + QStringList extensions; + QListinputOptions; + QListoutputOptions; + QString html; + static QString htmlBase; + +}; + +#endif diff --git a/gui/formatload.cpp b/gui/formatload.cpp index f9fc6562f..7caf39d83 100644 --- a/gui/formatload.cpp +++ b/gui/formatload.cpp @@ -1,5 +1,5 @@ // -*- c++ -*- -// $Id: formatload.cpp,v 1.2 2009/08/28 17:08:55 robertl Exp $ +// $Id: formatload.cpp,v 1.3 2009/11/02 20:38:02 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -51,6 +51,8 @@ bool FormatLoad::processFormat(Format &format) return false; } QString htmlPage = lines[currentLine++]; + htmlPage.replace(QRegExp("^[\\s]*"), ""); + htmlPage.replace(QRegExp("[\\s]$"), ""); QRegExp regex("^option"); QList optionList; @@ -108,7 +110,12 @@ bool FormatLoad::processFormat(Format &format) hfields[0] == "serial", QStringList() << hfields[3], optionList, - optionList2); + optionList2, htmlPage); + if (htmlPage.length() > 0 && Format::getHtmlBase().length() == 0) { + QString base = htmlPage; + base.replace(QRegExp("/[^/]+$"), "/"); + Format::setHtmlBase(base); + } return true; } diff --git a/gui/gmapdlg.cpp b/gui/gmapdlg.cpp index b3ac386fa..0b06ed660 100755 --- a/gui/gmapdlg.cpp +++ b/gui/gmapdlg.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: gmapdlg.cpp,v 1.2 2009/08/28 17:08:55 robertl Exp $ +// $Id: gmapdlg.cpp,v 1.3 2009/11/02 20:38:02 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -208,6 +208,9 @@ GMapDialog::GMapDialog(QWidget *parent, const QString &gpxFileName, QPlainTextEd connect(ui.treeView, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(showContextMenu(const QPoint &))); + connect(ui.copyButton, SIGNAL(clicked()), this, SLOT(copyButtonClickedX())); + + ui.copyButton->hide(); // Hide for now, not working } @@ -558,3 +561,7 @@ void GMapDialog::showContextMenu(const QPoint &pt) else { } } +//------------------------------------------------------------------------ +void GMapDialog::copyButtonClickedX() { + +} diff --git a/gui/gmapdlg.h b/gui/gmapdlg.h index f4082c15f..901ab4c38 100755 --- a/gui/gmapdlg.h +++ b/gui/gmapdlg.h @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: gmapdlg.h,v 1.1 2009/07/05 21:14:56 robertl Exp $ +// $Id: gmapdlg.h,v 1.2 2009/11/02 20:38:02 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -64,6 +64,7 @@ private slots: void routeClickedX(int i); void treeDoubleClicked(const QModelIndex &idx); void selectionChangedX (const QItemSelection &, const QItemSelection &); + void copyButtonClickedX(); void showContextMenu(const QPoint &); diff --git a/gui/gmapui.ui b/gui/gmapui.ui index 8bd7a011f..f0e13e1ea 100644 --- a/gui/gmapui.ui +++ b/gui/gmapui.ui @@ -13,38 +13,94 @@ Dialog - - - - - Qt::Horizontal - - - - - - 10 - 0 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Close - - + + + + + + + Qt::Horizontal + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Copy to Clipboard + + + Copy + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + 10 + 0 + + + + + 20 + 20 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + diff --git a/gui/help.cpp b/gui/help.cpp index da1b7989d..7abaf001b 100644 --- a/gui/help.cpp +++ b/gui/help.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: help.cpp,v 1.7 2009/09/14 14:25:14 robertl Exp $ +// $Id: help.cpp,v 1.8 2009/11/02 20:38:02 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -20,25 +20,22 @@ // USA // //------------------------------------------------------------------------ -#include "help.h" -#include #include -#include #include +#include "help.h" +#include "format.h" + //------------------------------------------------------------------------ -void ShowHelp(const char *name) +void ShowHelp(const QString &urlIn) + { - QString urlname("file:///" + QApplication::applicationDirPath() + - "/help/" + name); -#ifdef XXXX - // This has window modality problems. Unless the problem is solved, just use - // the native browser. - QWebView *view = new QWebView(); - view->setWindowTitle("GPSBabel Help"); - view->load(urlname); - view->show(); -#else - QDesktopServices::openUrl(QUrl(urlname)); -#endif + QString url = urlIn; + if (!url.contains(QRegExp("^http://"))) { + url = Format::getHtmlBase() + url; + } + QDesktopServices::openUrl(QUrl(url)); } + + + diff --git a/gui/help.h b/gui/help.h index edbbfeaf5..9cc3896ff 100644 --- a/gui/help.h +++ b/gui/help.h @@ -1,30 +1,30 @@ -// -*- C++ -*- -// $Id: help.h,v 1.3 2009/09/14 14:25:14 robertl Exp $ -//------------------------------------------------------------------------ -// -// Copyright (C) 2009 S. Khai Mong . -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 -// USA -// - -#ifndef HELP_H -#define HELP_H -#include - -extern void ShowHelp(const char *name); - - -#endif +// -*- C++ -*- +// $Id: help.h,v 1.4 2009/11/02 20:38:02 robertl Exp $ +//------------------------------------------------------------------------ +// +// Copyright (C) 2009 S. Khai Mong . +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation; either version 2 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 +// USA +// + +#ifndef HELP_H +#define HELP_H +#include + +extern void ShowHelp(const QString & name); + + +#endif diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index c5b06ffa0..914ce3f36 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: mainwindow.cpp,v 1.11 2009/09/15 18:04:03 robertl Exp $ +// $Id: mainwindow.cpp,v 1.12 2009/11/02 20:38:02 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -359,8 +359,7 @@ int MainWindow::currentComboFormatIndex(QComboBox *comboBox) { int idx = comboBox->currentIndex(); if (idx<0 || idx >= comboBox->count()) { - QMessageBox::critical(0, appName, - "*** Internal Error -- current combo index is invalid!"); + // QMessageBox::critical(0, appName, "*** Internal Error -- current combo index is invalid!"); return 0; } return comboBox->itemData(idx).toInt(); @@ -623,7 +622,8 @@ void MainWindow::inputOptionButtonClicked() else { OptionsDlg optionDlg(0, formatList[fidx].getName(), - formatList[fidx].getInputOptionsRef()); + formatList[fidx].getInputOptionsRef(), + formatList[fidx].getHtml()); optionDlg.setWindowTitle(QString(appName) + " - " + tr("Options for %1").arg(formatList[fidx].getName())); optionDlg.exec(); displayOptionsText(ui.inputOptionsText, ui.inputFormatCombo, true); @@ -640,7 +640,10 @@ void MainWindow::outputOptionButtonClicked() tr("There are no output options for format \"%1\"").arg(formatList[fidx].getDescription())); } else { - OptionsDlg optionDlg(0, formatList[fidx].getName(), formatList[fidx].getOutputOptionsRef()); + OptionsDlg optionDlg(0, + formatList[fidx].getName(), + formatList[fidx].getOutputOptionsRef(), + formatList[fidx].getHtml()); optionDlg.setWindowTitle(QString(appName) + " - " + tr("Options for %1").arg(formatList[fidx].getName())); optionDlg.exec(); displayOptionsText(ui.outputOptionsText, ui.outputFormatCombo, false); @@ -927,7 +930,7 @@ void MainWindow::resetFormatDefaults() void MainWindow::moreOptionButtonClicked() { AdvDlg advDlg(0, bd.synthShortNames, - bd.forceGPSTypes, bd.enableCharSetXform, bd.previewGmap, bd.debugLevel); + bd.enableCharSetXform, bd.previewGmap, bd.debugLevel); connect(advDlg.formatButton(), SIGNAL(clicked()), this, SLOT(resetFormatDefaults())); advDlg.exec(); diff --git a/gui/miscfltui.ui b/gui/miscfltui.ui index 565081efb..996fc4641 100644 --- a/gui/miscfltui.ui +++ b/gui/miscfltui.ui @@ -6,8 +6,8 @@ 0 0 - 297 - 107 + 303 + 175 @@ -28,6 +28,42 @@ + + + + Nuke (Remove) Data Types + + + + 4 + + + 4 + + + + + Routes + + + + + + + Tracks + + + + + + + Waypoints + + + + + + diff --git a/gui/optionsdlg.cpp b/gui/optionsdlg.cpp index cd4634ab6..277e00ac4 100644 --- a/gui/optionsdlg.cpp +++ b/gui/optionsdlg.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: optionsdlg.cpp,v 1.3 2009/09/08 16:06:32 robertl Exp $ +// $Id: optionsdlg.cpp,v 1.4 2009/11/02 20:38:02 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -81,10 +81,12 @@ void FileDlgManager::buttonClicked() } //------------------------------------------------------------------------ -OptionsDlg::OptionsDlg(QWidget*parent, const QString &fmtName, QList *opts): +OptionsDlg::OptionsDlg(QWidget*parent, const QString &fmtName, QList *opts, + const QString &html): QDialog(parent), fmtName(fmtName), - options(*opts) + options(*opts), + html(html) { QVBoxLayout *verticalLayout = new QVBoxLayout(this); @@ -95,6 +97,7 @@ OptionsDlg::OptionsDlg(QWidget*parent, const QString &fmtName, QListsetText(tr(options[k].getDescription().toAscii().data())); horizontalLayout->addWidget(checkBox); checkBox->setChecked(options[k].getSelected()); + //checkBox->setWhatsThis(options[k].getHtml()); QSpacerItem *horizontalSpacer = new QSpacerItem(0, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); horizontalLayout->addItem(horizontalSpacer); @@ -234,6 +237,5 @@ void OptionsDlg::rejectClicked() //------------------------------------------------------------------------ void OptionsDlg::helpClicked() { - QString str = "fmt_" + fmtName + ".html"; - ShowHelp(str.toStdString().c_str()); + ShowHelp(html); } diff --git a/gui/optionsdlg.h b/gui/optionsdlg.h index bced79b98..ba3b03130 100644 --- a/gui/optionsdlg.h +++ b/gui/optionsdlg.h @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: optionsdlg.h,v 1.1 2009/07/05 21:14:56 robertl Exp $ +// $Id: optionsdlg.h,v 1.2 2009/11/02 20:38:02 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -55,7 +55,8 @@ private slots: class OptionsDlg: public QDialog { Q_OBJECT public: - OptionsDlg(QWidget *parent, const QString &fmtName, QList *options); + OptionsDlg(QWidget *parent, const QString &fmtName, QList *options, + const QString &html); private: QString fmtName; @@ -63,6 +64,7 @@ Q_OBJECT QDialogButtonBox *buttonBox; QList checkBoxes; QList fields; + QString html; private slots: void acceptClicked(); diff --git a/gui/setup.iss b/gui/setup.iss index 45991b131..a0366579c 100755 --- a/gui/setup.iss +++ b/gui/setup.iss @@ -1,4 +1,4 @@ -; $Id: setup.iss,v 1.10 2009/10/12 13:23:51 robertl Exp $ +; $Id: setup.iss,v 1.11 2009/11/02 20:38:02 robertl Exp $ ; ; NOTE: setup.iss is generated from setup.iss.in via autoconf. ; The generated setup.iss is checked in to help keep the version numbers @@ -17,7 +17,7 @@ ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) AppId={{1B8FE958-A304-4902-BF7A-4E2F0F5B7017} AppName=GPSBabel -AppVerName=GPSBabel 1.3.7-beta20090906 +AppVerName=GPSBabel 1.3.7-beta20091003 AppPublisher=GPSBabel AppPublisherURL=http://www.gpsbabel.org AppSupportURL=http://www.gpsbabel.org @@ -25,7 +25,7 @@ AppUpdatesURL=http://www.gpsbabel.org DefaultDirName={pf}\GPSBabel DefaultGroupName=GPSBabel OutputDir=release -OutputBaseFilename=GPSBabel-1.3.7-beta20090906-Setup +OutputBaseFilename=GPSBabel-1.3.7-beta20091003-Setup SetupIconFile=images\babel2.ico Compression=lzma SolidCompression=yes diff --git a/gui/trackui.ui b/gui/trackui.ui index 91bf9ef88..9e42c93bf 100644 --- a/gui/trackui.ui +++ b/gui/trackui.ui @@ -6,8 +6,8 @@ 0 0 - 544 - 219 + 663 + 248 @@ -51,7 +51,7 @@ If this value contains a percent (%) character, it is treated as a format string - + the title of the new track is composed of the start time of the track appended to this value. @@ -86,7 +86,7 @@ This option changes the time of all trackpoints. This might be useful if your tr - + @@ -100,7 +100,7 @@ This option changes the time of all trackpoints. This might be useful if your tr - + @@ -114,7 +114,7 @@ This option changes the time of all trackpoints. This might be useful if your tr - + @@ -229,25 +229,24 @@ This option puts all track points from all tracks into a single track and sorts - - - - Split tracks. - - - Split by date or time interval - -The input track will be split into several tracks depending on date of track points. If there is more than one track, use the pack option before before using this. - -If the input has multiple tracks, pack them together before splitting them back apart per day. - + + + + Split by Date + + + + - Split + Split by Time + + + false - + @@ -280,7 +279,17 @@ If the input has multiple tracks, pack them together before splitting them back - + + + + Split by Dist. + + + false + + + + @@ -318,70 +327,66 @@ If the input has multiple tracks, pack them together before splitting them back - - - - Synthesize GPS Fixes. - - - Synthesize GPS fixes (PPS, DGPS, 3D, 2D, NONE). - -This option sets the GPS fix status for all trackpoints to the specified value. Valid values for this option are PPS, DGPS, 3D, 2D, or NONE. - -This option is most useful when converting from a format that doesn't contain GPS fix status to one that requires it. - - - - 0 - - - - - - 0 - 0 - + + + + + + + 0 + 0 + + + + GPS Fixes + + + + + + + + none + + - GPS Fixes + pps - - - - - - - none - - - - - pps - - - - - dgps - - - - - 3d - - - - - 2d - - - - - - GPSFixesCombo - GPSFixesCheck - + + + + dgps + + + + + 3d + + + + + 2d + + + + + + + + Qt::Horizontal + + + + 2 + 20 + + + + + - + Synthesize speed. @@ -396,7 +401,7 @@ This option computes a value for the GPS speed at each trackpoint. This is most - + Synthesize course. -- 2.30.2